<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #div1{width: 200px;height: 300px;background-color: gray;margin-left: 300px;margin-top: 0px;}
        #div2{width: 200px;height: 300px;background-color: black;margin-left: 300px;margin-top: 200px;}
        #btn1{text-align: center;width: 50px;height: 50px;}
    </style>
    <script>
        window.onload = function(){
            var aBtn = document.getElementById('btn1')
            aBtn.onclick = function(){
            }

            aBtn.ondblclick = function(){
                alert('双击')
            }

            aBtn.onmouseenter = function(){
                this.style.backgroundColor = 'red'
            }

            aBtn.onmouseleave = function(){
                this.style.backgroundColor = 'blue'
            }
        }
    </script>
</head>
<body>
    <div id = "div1">
        <button id = 'btn1'></button>
    </div>
    <div id = "div2">

    </div>
</body>
</html>